import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { CompanyCancelPage } from '../../pages/company-cancel/company-cancel';
import { CompanychangePage } from '../../pages/companychange/companychange';
import { LicenseagentPage } from '../../pages/licenseagent/licenseagent';
import { HomePage } from '../../pages/home/home';
/**
 * Generated class for the TopmenuComponent component.
 *
 * See https://angular.io/api/core/Component for more info on Angular
 * Components.
 */
@Component({
  selector: 'topmenu',
  templateUrl: 'topmenu.html'
})
export class TopmenuComponent {
  select : number;
  public list =[];
  public menuShow = false;
   constructor(public navCtrl: NavController ) {
    this.list=[
      {"id" : 1,"fun" :"goRegister", "name":"公司注册"},
      {"id" : 2,"fun" :"goLicenseagent", "name":"营业执照代办"},
      {"id" : 3,"fun" :"goLogout", "name":"公司注销"},
      {"id" : 4,"fun" :"goCompanyChange", "name":"公司变更"},
      ]
  }
  /*************************页面跳转start*************************/
  menuGoFun(funName,id){
    this[funName]();
    this.select = id;

  }
  goLogout(){
    this.navCtrl.push(CompanyCancelPage);//公司注销
  }
  goRegister(){
    this.navCtrl.push(HomePage);//公司注册
  }
  goCompanyChange(){
    this.navCtrl.push(CompanychangePage);//公司变更
  }
  goLicenseagent(){
    this.navCtrl.push(LicenseagentPage);//营业执照代办
  }
  changMenu(){
    this.menuShow = !this.menuShow;//菜单切换
  }
  showMenu(){
    this.menuShow = true;//显示菜单
  }
  hideMenu(){
    this.menuShow = false;//隐藏菜单
  }
  /*************************页面跳转 end*************************/
}
